<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录成功页面</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f9;
            margin: 0;
            padding: 0;
        }
        .header {
            background-color: #4CAF50;
            color: white;
            padding: 10px 0;
            text-align: center;
        }
        .header h1 {
            margin: 0;
        }
        .container {
            padding: 20px;
            text-align: center;
        }
        .container h2 {
            margin-bottom: 20px;
        }
        .container p {
            font-size: 18px;
            color: #333;
        }
        .button {
            display: inline-block;
            padding: 10px 20px;
            background-color: #28a745;
            color: white;
            text-decoration: none;
            border-radius: 4px;
            font-size: 16px;
            margin-top: 20px;
        }
        .button:hover {
            background-color: #218838;
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>登录成功</h1>
    </div>
    <div class="container">
        <h2>欢迎回来！</h2>
        <p>您已成功登录到我们的系统。</p>
        <button id="layout" class="button">退出登录</button>
    </div>
</body>

<script src="../js/axios.min.js"></script>

<script>
<!--  绑定事件  -->
    document.getElementById("layout").onclick=function () {
        const url="http://localhost:8080/login/out";
        axios
            .post(url)
            .then(function (response) {
                if (response.data.code==200){
                //     退出登录，跳转到登录页面
                    window.location.href="./login.html";
                }
            })
    }
</script>
</html>
